home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / progjrn / pj_7_5.arc / TEST2.C < prev    next >
C/C++ Source or Header  |  1989-07-03  |  766b  |  35 lines

  1. /*
  2.     TEST2.C - Same as TEST.C, except using objects
  3. */
  4.  
  5. #include "stdio.h"
  6. #include "pubclass.h"
  7.  
  8. main()
  9. {
  10.     int x;
  11.     Obj item;
  12.     Obj header=New(TwllHead);
  13.  
  14.     /* add 3 entries of each type to the list*/
  15.     for (x=3;x;x--) {
  16.         item=New(DataTwll);        /* create a new DataTwll Object */
  17.         Send(header,AddItem,item);
  18.         Send(item,SetX,x);
  19.  
  20.         item=New(MyDataTwll);      /* create a MyDataTwll */
  21.         Send(header,AddItem,item);
  22.         Send(item,SetA,"Sample.");
  23.  
  24.         item=New(OtherDataTwll);   /* create an OtherDataTwll */
  25.         Send(header,AddItem,item);
  26.         Send(item,SetA,x+100);
  27.         }
  28.  
  29.     /* print the contents of the list */
  30.     Send(header,SendAll,Print);
  31.  
  32.     exit(0);
  33. }
  34.  
  35.